package com.javaee.dao;

import com.javaee.domain.Product;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CartDao {
    @Insert("insert into cart (id,name,stock) values (#{id},#{name},#{stock}),")
    void add(Product product);
    @Delete("delete from cart where id = #{id}")
    void remove(String id);

    @Select("select * from cart")
    List<Product> listAll();
}
